<?php
use kartik\editable\Editable;


?>

<style type="text/css">
	 .color3{background:#2A6598 !important;}
</style>

<div class="col-md-12">
	<h2 class="page-header"><small>审批发票</small></h2>

	<?php if($model->invoice){ ?>
	   <?php foreach($model->invoice as $invoice){ ?>  	
		<div class="row" style="padding: 10px;border:1px solid #A664A6;margin-bottom: 10px;">
			<div class="col-xs-6 col-sm-4 pricing-box">
			<div class="widget-box">
				<div class="widget-header color3">发票</div>
				<div class="widget-body">
					<div class="widget-main">
						<ul class="list-unstyled"><li>服务项目 : <?=\yii::$app->params['invoice_name'][$invoice->name] ?></li></ul>
						
						<ul class="list-unstyled"><li>公司名称 : <?= $invoice->company ?></li></ul>
						<ul class="list-unstyled"><li>税号 : <?= $invoice->tax ?> </li></ul>
						<ul class="list-unstyled"><li>银行帐号 : <?= $invoice->bank_account ?></li></ul>
						<ul class="list-unstyled"><li>银行名称 : <?= $invoice->bank_name ?></li></ul>
						<ul class="list-unstyled"><li>地址 : <?= $invoice->address ?></li></ul>
						<ul class="list-unstyled"><li>电话 : <?= $invoice->phone ?></li></ul>
						<ul class="list-unstyled"><li>备注 : <?= $invoice->remark ?></li></ul>
						<ul class="list-unstyled"><li>状态 : <?= Yii::$app->params['invoice_status'][$invoice->status] ?></li></ul>
						<hr style="margin-bottom:10px;">
						<div class="price" style="color: #ea656a;">
							总金额 :
 							<?= Yii::$app->formatter->asCurrency($invoice->orderPrice) ?>
						</div>
					</div>
				</div>
				</div>
			</div>
			<div class="col-xs-6 col-sm-4">
				<div class="widget-box">
				<div class="widget-header color3">相关订单</div>
				<div class="widget-body">
					<div class="widget-main">
						<?php if(!empty($invoice->invoiceOrder)) { ?>
							<!-- 关联订单 -->
							<?php foreach($invoice->invoiceOrder as $order){ ?>
								<ul class="list-unstyled">
									<a style="display:inline-block;width:100%;" href="/order/order/view?id=<?= $order->order_id?>" target="_blank" ><?= $order->order->code ?></a>
									<font style="display:inline-block;width:30%;"><?= $order->order->username ?></font>
									<font style="display:inline-block;width:32%;"><?= $order->order->phone ?></font>
									<font style="display:inline-block;width:35%;color:#ea656a;font-weight:bold;">
										<?= Yii::$app->formatter->asCurrency($order->price) ?>
									</font>
								</ul>
								<hr>
							<?php } ?>
						<?php } ?>
					</div>
				</div>
				</div>
			</div>

			<!-- 审核界面 -->
			<div class="col-xs-6 col-sm-4">

			<?php
				if($model->type == 1 || $model->type ==2){ 
					echo $this->render('check-status', ['model' => $model,'invoice'=>$invoice,'role'=>$role]);
				}
			?>

		</div> 

	    </div>		
	   <?php }?>  
	<?php }?>

</div>